package com.scd.boot.model;

import com.scd.boot.enums.RequestCodeEnum;
import lombok.Data;

@Data
public class BaseResponse<T> {
    private String code;

    private String msg;

    private T data;

    public BaseResponse(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BaseResponse(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public BaseResponse(RequestCodeEnum requestCodeEnum, T data) {
        this.code = requestCodeEnum.getCode();
        this.msg = requestCodeEnum.getMsg();
        this.data = data;
    }
}
